<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
RandomDataGenerator (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="RandomDataGenerator (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/RandomDataGenerator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/random/RandomDataImpl.html" title="class in org.apache.commons.math3.random"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/random/RandomDataGenerator.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="RandomDataGenerator.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.random</FONT>
<BR>
Class RandomDataGenerator</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.random.RandomDataGenerator</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>, <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>RandomDataGenerator</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DL>
</PRE>

<P>
Implements the <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random"><CODE>RandomData</CODE></A> interface using a <A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random"><CODE>RandomGenerator</CODE></A>
 instance to generate non-secure data and a <A HREF="http://download.oracle.com/javase/6/docs/api/java/security/SecureRandom.html?is-external=true" title="class or interface in java.security"><CODE>SecureRandom</CODE></A>
 instance to provide data for the <code>nextSecureXxx</code> methods. If no
 <code>RandomGenerator</code> is provided in the constructor, the default is
 to use a <A HREF="../../../../../org/apache/commons/math3/random/Well19937c.html" title="class in org.apache.commons.math3.random"><CODE>Well19937c</CODE></A> generator. To plug in a different
 implementation, either implement <code>RandomGenerator</code> directly or
 extend <A HREF="../../../../../org/apache/commons/math3/random/AbstractRandomGenerator.html" title="class in org.apache.commons.math3.random"><CODE>AbstractRandomGenerator</CODE></A>.
 <p>
 Supports reseeding the underlying pseudo-random number generator (PRNG). The
 <code>SecurityProvider</code> and <code>Algorithm</code> used by the
 <code>SecureRandom</code> instance can also be reset.
 </p>
 <p>
 For details on the default PRNGs, see <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util"><CODE>Random</CODE></A> and
 <A HREF="http://download.oracle.com/javase/6/docs/api/java/security/SecureRandom.html?is-external=true" title="class or interface in java.security"><CODE>SecureRandom</CODE></A>.
 </p>
 <p>
 <strong>Usage Notes</strong>:
 <ul>
 <li>
 Instance variables are used to maintain <code>RandomGenerator</code> and
 <code>SecureRandom</code> instances used in data generation. Therefore, to
 generate a random sequence of values or strings, you should use just
 <strong>one</strong> <code>RandomDataImpl</code> instance repeatedly.</li>
 <li>
 The "secure" methods are *much* slower. These should be used only when a
 cryptographically secure random sequence is required. A secure random
 sequence is a sequence of pseudo-random values which, in addition to being
 well-dispersed (so no subsequence of values is an any more likely than other
 subsequence of the the same length), also has the additional property that
 knowledge of values generated up to any point in the sequence does not make
 it any easier to predict subsequent values.</li>
 <li>
 When a new <code>RandomDataImpl</code> is created, the underlying random
 number generators are <strong>not</strong> initialized. If you do not
 explicitly seed the default non-secure generator, it is seeded with the
 current time in milliseconds plus the system identity hash code on first use.
 The same holds for the secure generator. If you provide a <code>RandomGenerator</code>
 to the constructor, however, this generator is not reseeded by the constructor
 nor is it reseeded on first use.</li>
 <li>
 The <code>reSeed</code> and <code>reSeedSecure</code> methods delegate to the
 corresponding methods on the underlying <code>RandomGenerator</code> and
 <code>SecureRandom</code> instances. Therefore, <code>reSeed(long)</code>
 fully resets the initial state of the non-secure random number generator (so
 that reseeding with a specific value always results in the same subsequent
 random sequence); whereas reSeedSecure(long) does <strong>not</strong>
 reinitialize the secure random number generator (so secure sequences started
 with calls to reseedSecure(long) won't be identical).</li>
 <li>
 This implementation is not synchronized. The underlying <code>RandomGenerator</code>
 or <code>SecureRandom</code> instances are not protected by synchronization and
 are not guaranteed to be thread-safe.  Therefore, if an instance of this class
 is concurrently utilized by multiple threads, it is the responsibility of
 client code to synchronize access to seeding and data generation methods.
 </li>
 </ul>
 </p>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>3.1</DD>
<DT><B>Version:</B></DT>
  <DD>$Id: RandomDataGenerator.java 1462423 2013-03-29 07:25:18Z luc $</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#org.apache.commons.math3.random.RandomDataGenerator">Serialized Form</A></DL>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#RandomDataGenerator()">RandomDataGenerator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a RandomDataGenerator, using a default random generator as the source
 of randomness.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#RandomDataGenerator(org.apache.commons.math3.random.RandomGenerator)">RandomDataGenerator</A></B>(<A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random">RandomGenerator</A>&nbsp;rand)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a RandomDataGenerator using the supplied <A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random"><CODE>RandomGenerator</CODE></A> as
 the source of (non-secure) random data.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random">RandomGenerator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#getRandomGenerator()">getRandomGenerator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the RandomGenerator used to generate non-secure random data.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextBeta(double, double)">nextBeta</A></B>(double&nbsp;alpha,
         double&nbsp;beta)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/BetaDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Beta Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextBinomial(int, double)">nextBinomial</A></B>(int&nbsp;numberOfTrials,
             double&nbsp;probabilityOfSuccess)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/BinomialDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Binomial Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextCauchy(double, double)">nextCauchy</A></B>(double&nbsp;median,
           double&nbsp;scale)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/CauchyDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Cauchy Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextChiSquare(double)">nextChiSquare</A></B>(double&nbsp;df)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/ChiSquaredDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>ChiSquare Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextExponential(double)">nextExponential</A></B>(double&nbsp;mean)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the exponential distribution
 with specified mean.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextF(double, double)">nextF</A></B>(double&nbsp;numeratorDf,
      double&nbsp;denominatorDf)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/FDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>F Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextGamma(double, double)">nextGamma</A></B>(double&nbsp;shape,
          double&nbsp;scale)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the
 <A HREF="../../../../../org/apache/commons/math3/distribution/GammaDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Gamma Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextGaussian(double, double)">nextGaussian</A></B>(double&nbsp;mu,
             double&nbsp;sigma)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the Normal (or Gaussian) distribution with
 specified mean and standard deviation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextHexString(int)">nextHexString</A></B>(int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random string of hex characters of length <code>len</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextHypergeometric(int, int, int)">nextHypergeometric</A></B>(int&nbsp;populationSize,
                   int&nbsp;numberOfSuccesses,
                   int&nbsp;sampleSize)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/HypergeometricDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Hypergeometric Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextInt(int, int)">nextInt</A></B>(int&nbsp;lower,
        int&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a uniformly distributed random integer between <code>lower</code>
 and <code>upper</code> (endpoints included).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextLong(long, long)">nextLong</A></B>(long&nbsp;lower,
         long&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a uniformly distributed random long integer between
 <code>lower</code> and <code>upper</code> (endpoints included).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextPascal(int, double)">nextPascal</A></B>(int&nbsp;r,
           double&nbsp;p)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/PascalDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Pascal Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextPermutation(int, int)">nextPermutation</A></B>(int&nbsp;n,
                int&nbsp;k)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates an integer array of length <code>k</code> whose entries are selected
 randomly, without repetition, from the integers <code>0, ..., n - 1</code>
 (inclusive).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextPoisson(double)">nextPoisson</A></B>(double&nbsp;mean)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the Poisson distribution with the given
 mean.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextSample(java.util.Collection, int)">nextSample</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;c,
           int&nbsp;k)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of <code>k</code> objects selected randomly from the
 Collection <code>c</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextSecureHexString(int)">nextSecureHexString</A></B>(int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random string of hex characters from a secure random
 sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextSecureInt(int, int)">nextSecureInt</A></B>(int&nbsp;lower,
              int&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a uniformly distributed random integer between <code>lower</code>
 and <code>upper</code> (endpoints included) from a secure random sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextSecureLong(long, long)">nextSecureLong</A></B>(long&nbsp;lower,
               long&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a uniformly distributed random long integer between
 <code>lower</code> and <code>upper</code> (endpoints included) from a secure random
 sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextT(double)">nextT</A></B>(double&nbsp;df)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/TDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>T Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextUniform(double, double)">nextUniform</A></B>(double&nbsp;lower,
            double&nbsp;upper)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a uniformly distributed random value from the open interval
 <code>(lower, upper)</code> (i.e., endpoints excluded).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextUniform(double, double, boolean)">nextUniform</A></B>(double&nbsp;lower,
            double&nbsp;upper,
            boolean&nbsp;lowerInclusive)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a uniformly distributed random value from the interval
 <code>(lower, upper)</code> or the interval <code>[lower, upper)</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextWeibull(double, double)">nextWeibull</A></B>(double&nbsp;shape,
            double&nbsp;scale)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/WeibullDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Weibull Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#nextZipf(int, double)">nextZipf</A></B>(int&nbsp;numberOfElements,
         double&nbsp;exponent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Zipf Distribution</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#reSeed()">reSeed</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reseeds the random number generator with
 <code>System.currentTimeMillis() + System.identityHashCode(this))</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#reSeed(long)">reSeed</A></B>(long&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reseeds the random number generator with the supplied seed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#reSeedSecure()">reSeedSecure</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reseeds the secure random number generator with the current time in
 milliseconds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#reSeedSecure(long)">reSeedSecure</A></B>(long&nbsp;seed)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reseeds the secure random number generator with the supplied seed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/random/RandomDataGenerator.html#setSecureAlgorithm(java.lang.String, java.lang.String)">setSecureAlgorithm</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithm,
                   <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;provider)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the PRNG algorithm for the underlying SecureRandom instance using
 the Security Provider API.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="RandomDataGenerator()"><!-- --></A><H3>
RandomDataGenerator</H3>
<PRE>
public <B>RandomDataGenerator</B>()</PRE>
<DL>
<DD>Construct a RandomDataGenerator, using a default random generator as the source
 of randomness.

 <p>The default generator is a <A HREF="../../../../../org/apache/commons/math3/random/Well19937c.html" title="class in org.apache.commons.math3.random"><CODE>Well19937c</CODE></A> seeded
 with <code>System.currentTimeMillis() + System.identityHashCode(this))</code>.
 The generator is initialized and seeded on first use.</p>
<P>
</DL>
<HR>

<A NAME="RandomDataGenerator(org.apache.commons.math3.random.RandomGenerator)"><!-- --></A><H3>
RandomDataGenerator</H3>
<PRE>
public <B>RandomDataGenerator</B>(<A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random">RandomGenerator</A>&nbsp;rand)</PRE>
<DL>
<DD>Construct a RandomDataGenerator using the supplied <A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random"><CODE>RandomGenerator</CODE></A> as
 the source of (non-secure) random data.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>rand</CODE> - the source of (non-secure) random data
 (may be null, resulting in the default generator)</DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="nextHexString(int)"><!-- --></A><H3>
nextHexString</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>nextHexString</B>(int&nbsp;len)
                     throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random string of hex characters of length <code>len</code>.
 <p>
 The generated string will be random, but not cryptographically
 secure. To generate cryptographically secure strings, use
 <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextSecureHexString(int)"><CODE>RandomData.nextSecureHexString(int)</CODE></A>.
 </p>
 <p>
 <strong>Algorithm Description:</strong> hex strings are generated using a
 2-step process.
 <ol>
 <li><code>len / 2 + 1</code> binary bytes are generated using the underlying
 Random</li>
 <li>Each binary byte is translated into 2 hex digits</li>
 </ol>
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextHexString(int)">nextHexString</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>len</CODE> - the desired string length.
<DT><B>Returns:</B><DD>the random string.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>len &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextInt(int, int)"><!-- --></A><H3>
nextInt</H3>
<PRE>
public int <B>nextInt</B>(int&nbsp;lower,
                   int&nbsp;upper)
            throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Generates a uniformly distributed random integer between <code>lower</code>
 and <code>upper</code> (endpoints included).
 <p>
 The generated integer will be random, but not cryptographically secure.
 To generate cryptographically secure integer sequences, use
 <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextSecureInt(int, int)"><CODE>RandomData.nextSecureInt(int, int)</CODE></A>.
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextInt(int, int)">nextInt</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - lower bound for generated integer<DD><CODE>upper</CODE> - upper bound for generated integer
<DT><B>Returns:</B><DD>a random integer greater than or equal to <code>lower</code>
 and less than or equal to <code>upper</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= upper</code></DL>
</DD>
</DL>
<HR>

<A NAME="nextLong(long, long)"><!-- --></A><H3>
nextLong</H3>
<PRE>
public long <B>nextLong</B>(long&nbsp;lower,
                     long&nbsp;upper)
              throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Generates a uniformly distributed random long integer between
 <code>lower</code> and <code>upper</code> (endpoints included).
 <p>
 The generated long integer values will be random, but not
 cryptographically secure. To generate cryptographically secure sequences
 of longs, use <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextSecureLong(long, long)"><CODE>RandomData.nextSecureLong(long, long)</CODE></A>.
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextLong(long, long)">nextLong</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - lower bound for generated long integer<DD><CODE>upper</CODE> - upper bound for generated long integer
<DT><B>Returns:</B><DD>a random long integer greater than or equal to <code>lower</code> and
 less than or equal to <code>upper</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= upper</code></DL>
</DD>
</DL>
<HR>

<A NAME="nextSecureHexString(int)"><!-- --></A><H3>
nextSecureHexString</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>nextSecureHexString</B>(int&nbsp;len)
                           throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random string of hex characters from a secure random
 sequence.
 <p>
 If cryptographic security is not required, use
 <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextHexString(int)"><CODE>RandomData.nextHexString(int)</CODE></A>.
 </p>
 <p>
 <strong>Algorithm Description:</strong> hex strings are generated in
 40-byte segments using a 3-step process.
 <ol>
 <li>
 20 random bytes are generated using the underlying
 <code>SecureRandom</code>.</li>
 <li>
 SHA-1 hash is applied to yield a 20-byte binary digest.</li>
 <li>
 Each byte of the binary digest is converted to 2 hex digits.</li>
 </ol>
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextSecureHexString(int)">nextSecureHexString</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>len</CODE> - the length of the string to be generated
<DT><B>Returns:</B><DD>a random string of hex characters of length <code>len</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>len &lt;= 0</code></DL>
</DD>
</DL>
<HR>

<A NAME="nextSecureInt(int, int)"><!-- --></A><H3>
nextSecureInt</H3>
<PRE>
public int <B>nextSecureInt</B>(int&nbsp;lower,
                         int&nbsp;upper)
                  throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Generates a uniformly distributed random integer between <code>lower</code>
 and <code>upper</code> (endpoints included) from a secure random sequence.
 <p>
 Sequences of integers generated using this method will be
 cryptographically secure. If cryptographic security is not required,
 <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextInt(int, int)"><CODE>RandomData.nextInt(int, int)</CODE></A> should be used instead of this method.</p>
 <p>
 <strong>Definition</strong>:
 <a href="http://en.wikipedia.org/wiki/Cryptographically_secure_pseudo-random_number_generator">
 Secure Random Sequence</a></p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextSecureInt(int, int)">nextSecureInt</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - lower bound for generated integer<DD><CODE>upper</CODE> - upper bound for generated integer
<DT><B>Returns:</B><DD>a random integer greater than or equal to <code>lower</code> and less
 than or equal to <code>upper</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= upper</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextSecureLong(long, long)"><!-- --></A><H3>
nextSecureLong</H3>
<PRE>
public long <B>nextSecureLong</B>(long&nbsp;lower,
                           long&nbsp;upper)
                    throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Generates a uniformly distributed random long integer between
 <code>lower</code> and <code>upper</code> (endpoints included) from a secure random
 sequence.
 <p>
 Sequences of long values generated using this method will be
 cryptographically secure. If cryptographic security is not required,
 <A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextLong(long, long)"><CODE>RandomData.nextLong(long, long)</CODE></A> should be used instead of this method.</p>
 <p>
 <strong>Definition</strong>:
 <a href="http://en.wikipedia.org/wiki/Cryptographically_secure_pseudo-random_number_generator">
 Secure Random Sequence</a></p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextSecureLong(long, long)">nextSecureLong</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - lower bound for generated integer<DD><CODE>upper</CODE> - upper bound for generated integer
<DT><B>Returns:</B><DD>a random long integer greater than or equal to <code>lower</code> and
 less than or equal to <code>upper</code>.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= upper</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextPoisson(double)"><!-- --></A><H3>
nextPoisson</H3>
<PRE>
public long <B>nextPoisson</B>(double&nbsp;mean)
                 throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random value from the Poisson distribution with the given
 mean.
 <p>
 <strong>Definition</strong>:
 <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda366j.htm">
 Poisson Distribution</a></p>
 <p>
 <strong>Algorithm Description</strong>:
 <ul><li> For small means, uses simulation of a Poisson process
 using Uniform deviates, as described
 <a href="http://irmi.epfl.ch/cmos/Pmmi/interactive/rng7.htm"> here.</a>
 The Poisson process (and hence value returned) is bounded by 1000 * mean.</li>

 <li> For large means, uses the rejection algorithm described in <br/>
 Devroye, Luc. (1981).<i>The Computer Generation of Poisson Random Variables</i>
 <strong>Computing</strong> vol. 26 pp. 197-207.</li></ul></p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextPoisson(double)">nextPoisson</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mean</CODE> - the mean of the Poisson distribution
<DT><B>Returns:</B><DD>a random value following the specified Poisson distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>len &lt;= 0</code></DL>
</DD>
</DL>
<HR>

<A NAME="nextGaussian(double, double)"><!-- --></A><H3>
nextGaussian</H3>
<PRE>
public double <B>nextGaussian</B>(double&nbsp;mu,
                           double&nbsp;sigma)
                    throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random value from the Normal (or Gaussian) distribution with
 specified mean and standard deviation.
 <p>
 <strong>Definition</strong>:
 <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3661.htm">
 Normal Distribution</a></p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextGaussian(double, double)">nextGaussian</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mu</CODE> - the mean of the distribution<DD><CODE>sigma</CODE> - the standard deviation of the distribution
<DT><B>Returns:</B><DD>a random value following the specified Gaussian distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>sigma &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextExponential(double)"><!-- --></A><H3>
nextExponential</H3>
<PRE>
public double <B>nextExponential</B>(double&nbsp;mean)
                       throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random value from the exponential distribution
 with specified mean.
 <p>
 <strong>Definition</strong>:
 <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3667.htm">
 Exponential Distribution</a></p>

 <p>
 <strong>Algorithm Description</strong>: Uses the Algorithm SA (Ahrens)
 from p. 876 in:
 [1]: Ahrens, J. H. and Dieter, U. (1972). Computer methods for
 sampling from the exponential and normal distributions.
 Communications of the ACM, 15, 873-882.
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextExponential(double)">nextExponential</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mean</CODE> - the mean of the distribution
<DT><B>Returns:</B><DD>a random value following the specified exponential distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>mean &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextGamma(double, double)"><!-- --></A><H3>
nextGamma</H3>
<PRE>
public double <B>nextGamma</B>(double&nbsp;shape,
                        double&nbsp;scale)
                 throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD><p>Generates a random value from the
 <A HREF="../../../../../org/apache/commons/math3/distribution/GammaDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Gamma Distribution</CODE></A>.</p>

 <p>This implementation uses the following algorithms: </p>

 <p>For 0 < shape < 1: <br/>
 Ahrens, J. H. and Dieter, U., <i>Computer methods for
 sampling from gamma, beta, Poisson and binomial distributions.</i>
 Computing, 12, 223-246, 1974.</p>

 <p>For shape >= 1: <br/>
 Marsaglia and Tsang, <i>A Simple Method for Generating
 Gamma Variables.</i> ACM Transactions on Mathematical Software,
 Volume 26 Issue 3, September, 2000.</p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shape</CODE> - the median of the Gamma distribution<DD><CODE>scale</CODE> - the scale parameter of the Gamma distribution
<DT><B>Returns:</B><DD>random value sampled from the Gamma(shape, scale) distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>shape &lt;= 0</code> or
 <code>scale &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextHypergeometric(int, int, int)"><!-- --></A><H3>
nextHypergeometric</H3>
<PRE>
public int <B>nextHypergeometric</B>(int&nbsp;populationSize,
                              int&nbsp;numberOfSuccesses,
                              int&nbsp;sampleSize)
                       throws <A HREF="../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A>,
                              <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A>,
                              <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/HypergeometricDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Hypergeometric Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>populationSize</CODE> - the population size of the Hypergeometric distribution<DD><CODE>numberOfSuccesses</CODE> - number of successes in the population of the Hypergeometric distribution<DD><CODE>sampleSize</CODE> - the sample size of the Hypergeometric distribution
<DT><B>Returns:</B><DD>random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>numberOfSuccesses &gt; populationSize</code>,
 or <code>sampleSize &gt; populationSize</code>.
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>populationSize &lt;= 0</code>.
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotPositiveException.html" title="class in org.apache.commons.math3.exception">NotPositiveException</A></CODE> - if <code>numberOfSuccesses &lt; 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextPascal(int, double)"><!-- --></A><H3>
nextPascal</H3>
<PRE>
public int <B>nextPascal</B>(int&nbsp;r,
                      double&nbsp;p)
               throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A>,
                      <A HREF="../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</A></PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/PascalDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Pascal Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>r</CODE> - the number of successes of the Pascal distribution<DD><CODE>p</CODE> - the probability of success of the Pascal distribution
<DT><B>Returns:</B><DD>random value sampled from the Pascal(r, p) distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if the number of successes is not positive
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/OutOfRangeException.html" title="class in org.apache.commons.math3.exception">OutOfRangeException</A></CODE> - if the probability of success is not in the
 range <code>[0, 1]</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextT(double)"><!-- --></A><H3>
nextT</H3>
<PRE>
public double <B>nextT</B>(double&nbsp;df)
             throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/TDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>T Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>df</CODE> - the degrees of freedom of the T distribution
<DT><B>Returns:</B><DD>random value from the T(df) distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>df &lt;= 0</code></DL>
</DD>
</DL>
<HR>

<A NAME="nextWeibull(double, double)"><!-- --></A><H3>
nextWeibull</H3>
<PRE>
public double <B>nextWeibull</B>(double&nbsp;shape,
                          double&nbsp;scale)
                   throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/WeibullDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Weibull Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shape</CODE> - the shape parameter of the Weibull distribution<DD><CODE>scale</CODE> - the scale parameter of the Weibull distribution
<DT><B>Returns:</B><DD>random value sampled from the Weibull(shape, size) distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>shape &lt;= 0</code> or
 <code>scale &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextZipf(int, double)"><!-- --></A><H3>
nextZipf</H3>
<PRE>
public int <B>nextZipf</B>(int&nbsp;numberOfElements,
                    double&nbsp;exponent)
             throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Zipf Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>numberOfElements</CODE> - the number of elements of the ZipfDistribution<DD><CODE>exponent</CODE> - the exponent of the ZipfDistribution
<DT><B>Returns:</B><DD>random value sampled from the Zipf(numberOfElements, exponent) distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>numberOfElements &lt;= 0</code>
 or <code>exponent &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextBeta(double, double)"><!-- --></A><H3>
nextBeta</H3>
<PRE>
public double <B>nextBeta</B>(double&nbsp;alpha,
                       double&nbsp;beta)</PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/BetaDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Beta Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>alpha</CODE> - first distribution shape parameter<DD><CODE>beta</CODE> - second distribution shape parameter
<DT><B>Returns:</B><DD>random value sampled from the beta(alpha, beta) distribution</DL>
</DD>
</DL>
<HR>

<A NAME="nextBinomial(int, double)"><!-- --></A><H3>
nextBinomial</H3>
<PRE>
public int <B>nextBinomial</B>(int&nbsp;numberOfTrials,
                        double&nbsp;probabilityOfSuccess)</PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/BinomialDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Binomial Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>numberOfTrials</CODE> - number of trials of the Binomial distribution<DD><CODE>probabilityOfSuccess</CODE> - probability of success of the Binomial distribution
<DT><B>Returns:</B><DD>random value sampled from the Binomial(numberOfTrials, probabilityOfSuccess) distribution</DL>
</DD>
</DL>
<HR>

<A NAME="nextCauchy(double, double)"><!-- --></A><H3>
nextCauchy</H3>
<PRE>
public double <B>nextCauchy</B>(double&nbsp;median,
                         double&nbsp;scale)</PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/CauchyDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>Cauchy Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>median</CODE> - the median of the Cauchy distribution<DD><CODE>scale</CODE> - the scale parameter of the Cauchy distribution
<DT><B>Returns:</B><DD>random value sampled from the Cauchy(median, scale) distribution</DL>
</DD>
</DL>
<HR>

<A NAME="nextChiSquare(double)"><!-- --></A><H3>
nextChiSquare</H3>
<PRE>
public double <B>nextChiSquare</B>(double&nbsp;df)</PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/ChiSquaredDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>ChiSquare Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>df</CODE> - the degrees of freedom of the ChiSquare distribution
<DT><B>Returns:</B><DD>random value sampled from the ChiSquare(df) distribution</DL>
</DD>
</DL>
<HR>

<A NAME="nextF(double, double)"><!-- --></A><H3>
nextF</H3>
<PRE>
public double <B>nextF</B>(double&nbsp;numeratorDf,
                    double&nbsp;denominatorDf)
             throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates a random value from the <A HREF="../../../../../org/apache/commons/math3/distribution/FDistribution.html" title="class in org.apache.commons.math3.distribution"><CODE>F Distribution</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>numeratorDf</CODE> - the numerator degrees of freedom of the F distribution<DD><CODE>denominatorDf</CODE> - the denominator degrees of freedom of the F distribution
<DT><B>Returns:</B><DD>random value sampled from the F(numeratorDf, denominatorDf) distribution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if
 <code>numeratorDf &lt;= 0</code> or <code>denominatorDf &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextUniform(double, double)"><!-- --></A><H3>
nextUniform</H3>
<PRE>
public double <B>nextUniform</B>(double&nbsp;lower,
                          double&nbsp;upper)
                   throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A>,
                          <A HREF="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</A>,
                          <A HREF="../../../../../org/apache/commons/math3/exception/NotANumberException.html" title="class in org.apache.commons.math3.exception">NotANumberException</A></PRE>
<DL>
<DD>Generates a uniformly distributed random value from the open interval
 <code>(lower, upper)</code> (i.e., endpoints excluded).
 <p>
 <strong>Definition</strong>:
 <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3662.htm">
 Uniform Distribution</a> <code>lower</code> and <code>upper - lower</code> are the
 <a href = "http://www.itl.nist.gov/div898/handbook/eda/section3/eda364.htm">
 location and scale parameters</a>, respectively.</p>

 <p>
 <strong>Algorithm Description</strong>: scales the output of
 Random.nextDouble(), but rejects 0 values (i.e., will generate another
 random double if Random.nextDouble() returns 0). This is necessary to
 provide a symmetric output interval (both endpoints excluded).
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextUniform(double, double)">nextUniform</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - the exclusive lower bound of the support<DD><CODE>upper</CODE> - the exclusive upper bound of the support
<DT><B>Returns:</B><DD>a uniformly distributed random value between lower and upper
 (exclusive)
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= upper</code>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</A></CODE> - if one of the bounds is infinite
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotANumberException.html" title="class in org.apache.commons.math3.exception">NotANumberException</A></CODE> - if one of the bounds is NaN</DL>
</DD>
</DL>
<HR>

<A NAME="nextUniform(double, double, boolean)"><!-- --></A><H3>
nextUniform</H3>
<PRE>
public double <B>nextUniform</B>(double&nbsp;lower,
                          double&nbsp;upper,
                          boolean&nbsp;lowerInclusive)
                   throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A>,
                          <A HREF="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</A>,
                          <A HREF="../../../../../org/apache/commons/math3/exception/NotANumberException.html" title="class in org.apache.commons.math3.exception">NotANumberException</A></PRE>
<DL>
<DD>Generates a uniformly distributed random value from the interval
 <code>(lower, upper)</code> or the interval <code>[lower, upper)</code>. The lower
 bound is thus optionally included, while the upper bound is always
 excluded.
 <p>
 <strong>Definition</strong>:
 <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3662.htm">
 Uniform Distribution</a> <code>lower</code> and <code>upper - lower</code> are the
 <a href = "http://www.itl.nist.gov/div898/handbook/eda/section3/eda364.htm">
 location and scale parameters</a>, respectively.</p>

 <p>
 <strong>Algorithm Description</strong>: if the lower bound is excluded,
 scales the output of Random.nextDouble(), but rejects 0 values (i.e.,
 will generate another random double if Random.nextDouble() returns 0).
 This is necessary to provide a symmetric output interval (both
 endpoints excluded).
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextUniform(double, double, boolean)">nextUniform</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lower</CODE> - the lower bound of the support<DD><CODE>upper</CODE> - the exclusive upper bound of the support<DD><CODE>lowerInclusive</CODE> - <code>true</code> if the lower bound is inclusive
<DT><B>Returns:</B><DD>uniformly distributed random value in the <code>(lower, upper)</code>
 interval, if <code>lowerInclusive</code> is <code>false</code>, or in the
 <code>[lower, upper)</code> interval, if <code>lowerInclusive</code> is
 <code>true</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>lower &gt;= upper</code>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</A></CODE> - if one of the bounds is infinite
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotANumberException.html" title="class in org.apache.commons.math3.exception">NotANumberException</A></CODE> - if one of the bounds is NaN</DL>
</DD>
</DL>
<HR>

<A NAME="nextPermutation(int, int)"><!-- --></A><H3>
nextPermutation</H3>
<PRE>
public int[] <B>nextPermutation</B>(int&nbsp;n,
                             int&nbsp;k)
                      throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A>,
                             <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Generates an integer array of length <code>k</code> whose entries are selected
 randomly, without repetition, from the integers <code>0, ..., n - 1</code>
 (inclusive).
 <p>
 Generated arrays represent permutations of <code>n</code> taken <code>k</code> at a
 time.</p>

 <p>
 Uses a 2-cycle permutation shuffle. The shuffling process is described <a
 href="http://www.maths.abdn.ac.uk/~igc/tch/mx4002/notes/node83.html">
 here</a>.
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextPermutation(int, int)">nextPermutation</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - the domain of the permutation<DD><CODE>k</CODE> - the size of the permutation
<DT><B>Returns:</B><DD>a random <code>k</code>-permutation of <code>n</code>, as an array of
 integers
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>k &gt; n</code>.
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>k &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="nextSample(java.util.Collection, int)"><!-- --></A><H3>
nextSample</H3>
<PRE>
public <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] <B>nextSample</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;?&gt;&nbsp;c,
                           int&nbsp;k)
                    throws <A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A>,
                           <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Returns an array of <code>k</code> objects selected randomly from the
 Collection <code>c</code>.
 <p>
 Sampling from <code>c</code> is without replacement; but if <code>c</code> contains
 identical objects, the sample may include repeats.  If all elements of
 <code>c</code> are distinct, the resulting object array represents a
 <a href="http://rkb.home.cern.ch/rkb/AN16pp/node250.html#SECTION0002500000000000000000">
 Simple Random Sample</a> of size <code>k</code> from the elements of
 <code>c</code>.</p>

 <p>
 <strong>Algorithm Description</strong>: Uses a 2-cycle permutation
 shuffle to generate a random permutation of <code>c.size()</code> and
 then returns the elements whose indexes correspond to the elements of the
 generated permutation. This technique is described, and proven to
 generate random samples <a
 href="http://www.maths.abdn.ac.uk/~igc/tch/mx4002/notes/node83.html">
 here</a>
 </p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html#nextSample(java.util.Collection, int)">nextSample</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random">RandomData</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>c</CODE> - the collection to be sampled<DD><CODE>k</CODE> - the size of the sample
<DT><B>Returns:</B><DD>a random sample of <code>k</code> elements from <code>c</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</A></CODE> - if <code>k &gt; c.size()</code>.
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>k &lt;= 0</code>.</DL>
</DD>
</DL>
<HR>

<A NAME="reSeed(long)"><!-- --></A><H3>
reSeed</H3>
<PRE>
public void <B>reSeed</B>(long&nbsp;seed)</PRE>
<DL>
<DD>Reseeds the random number generator with the supplied seed.
 <p>
 Will create and initialize if null.
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the seed value to use</DL>
</DD>
</DL>
<HR>

<A NAME="reSeedSecure()"><!-- --></A><H3>
reSeedSecure</H3>
<PRE>
public void <B>reSeedSecure</B>()</PRE>
<DL>
<DD>Reseeds the secure random number generator with the current time in
 milliseconds.
 <p>
 Will create and initialize if null.
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="reSeedSecure(long)"><!-- --></A><H3>
reSeedSecure</H3>
<PRE>
public void <B>reSeedSecure</B>(long&nbsp;seed)</PRE>
<DL>
<DD>Reseeds the secure random number generator with the supplied seed.
 <p>
 Will create and initialize if null.
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>seed</CODE> - the seed value to use</DL>
</DD>
</DL>
<HR>

<A NAME="reSeed()"><!-- --></A><H3>
reSeed</H3>
<PRE>
public void <B>reSeed</B>()</PRE>
<DL>
<DD>Reseeds the random number generator with
 <code>System.currentTimeMillis() + System.identityHashCode(this))</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="setSecureAlgorithm(java.lang.String, java.lang.String)"><!-- --></A><H3>
setSecureAlgorithm</H3>
<PRE>
public void <B>setSecureAlgorithm</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;algorithm,
                               <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;provider)
                        throws <A HREF="http://download.oracle.com/javase/6/docs/api/java/security/NoSuchAlgorithmException.html?is-external=true" title="class or interface in java.security">NoSuchAlgorithmException</A>,
                               <A HREF="http://download.oracle.com/javase/6/docs/api/java/security/NoSuchProviderException.html?is-external=true" title="class or interface in java.security">NoSuchProviderException</A></PRE>
<DL>
<DD>Sets the PRNG algorithm for the underlying SecureRandom instance using
 the Security Provider API. The Security Provider API is defined in <a
 href =
 "http://java.sun.com/j2se/1.3/docs/guide/security/CryptoSpec.html#AppA">
 Java Cryptography Architecture API Specification & Reference.</a>
 <p>
 <strong>USAGE NOTE:</strong> This method carries <i>significant</i>
 overhead and may take several seconds to execute.
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>algorithm</CODE> - the name of the PRNG algorithm<DD><CODE>provider</CODE> - the name of the provider
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/security/NoSuchAlgorithmException.html?is-external=true" title="class or interface in java.security">NoSuchAlgorithmException</A></CODE> - if the specified algorithm is not available
<DD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/security/NoSuchProviderException.html?is-external=true" title="class or interface in java.security">NoSuchProviderException</A></CODE> - if the specified provider is not installed</DL>
</DD>
</DL>
<HR>

<A NAME="getRandomGenerator()"><!-- --></A><H3>
getRandomGenerator</H3>
<PRE>
public <A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random">RandomGenerator</A> <B>getRandomGenerator</B>()</PRE>
<DL>
<DD>Returns the RandomGenerator used to generate non-secure random data.
 <p>
 Creates and initializes a default generator if null. Uses a <A HREF="../../../../../org/apache/commons/math3/random/Well19937c.html" title="class in org.apache.commons.math3.random"><CODE>Well19937c</CODE></A>
 generator with <code>System.currentTimeMillis() + System.identityHashCode(this))</code>
 as the default seed.
 </p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the Random used to generate random data<DT><B>Since:</B></DT>
  <DD>3.2</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/RandomDataGenerator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/random/RandomData.html" title="interface in org.apache.commons.math3.random"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/random/RandomDataImpl.html" title="class in org.apache.commons.math3.random"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/random/RandomDataGenerator.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="RandomDataGenerator.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
